package com.yst.suivi.data.vacationday;

import java.text.MessageFormat;

import javax.ejb.CreateException;
import javax.ejb.EntityBean;

import com.yst.suivi.data.AbstractEntityBean;

/**
 * @author stolf
 * @ejb.bean name="VacationDay" type="CMP" cmp-version="2.x"
 *           schema="vacationDay" local-jndi-name="VacationDayBean"
 *           view-type="local" primkey-field = "id" reentrant = "True"
 * @ejb.home generate="local"
 * @ejb.persistence table-name = "vacationday"
 * @jboss.entity-command name = "key-generator"
 * @jboss.read-ahead eager-load-group = "most" strategy = "on-load"
 *                   page-size="25"
 * @jboss.load-group name="most"
 * @ejb.interface local-extends = "javax.ejb.EJBLocalObject"
 * @ejb.finder signature="java.util.Collection findAll()" query="SELECT
 *             OBJECT(g) FROM vacationDay AS g"
 */
public abstract class VacationDayBean extends AbstractEntityBean implements EntityBean
{
	/**
	 * @return
	 * @throws CreateException
	 * @ejb.create-method view-type = "local"
	 */
	public String ejbCreate() throws CreateException
	{
		return null;
	}

	public void ejbPostCreate()
	{
		// by default nothing to do
	}

	/**
	 * Return the primary key of the object
	 * 
	 * @ejb.interface-method view-type = "local"
	 * @ejb.persistence
	 * @jboss.jdbc-type type = "VARCHAR"
	 * @jboss.sql-type type = "VARCHAR(255)"
	 */
	public abstract String getId();

	/**
	 * Fix the primary key of the object. The method should be used only by the
	 * container
	 * 
	 * @ejb.interface-method view-type = "local"
	 */
	public abstract void setId(String id);

	/**
	 * Return the day of the object
	 * 
	 * @ejb.interface-method view-type = "local"
	 * @ejb.persistence
	 * @jboss.load-group name="most"
	 */
	public abstract Integer getJour();

	/**
	 * Fix the day of the user.
	 * 
	 * @ejb.interface-method view-type = "local"
	 */
	public abstract void setJour(Integer jour);

	/**
	 * Return the day of the object
	 * 
	 * @ejb.interface-method view-type = "local"
	 * @ejb.persistence
	 * @jboss.load-group name="most"
	 */
	public abstract Integer getMois();

	/**
	 * Fix the day of the user.
	 * 
	 * @ejb.interface-method view-type = "local"
	 */
	public abstract void setMois(Integer mois);

	/**
	 * Return the day of the object
	 * 
	 * @ejb.interface-method view-type = "local"
	 * @ejb.persistence
	 * @jboss.load-group name="most"
	 */
	public abstract Integer getAnnee();

	/**
	 * Fix the day of the user.
	 * 
	 * @ejb.interface-method view-type = "local"
	 */
	public abstract void setAnnee(Integer annee);

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	public String toString()
	{
		Object[] arguments = new Object[3];
		arguments[0] = getJour();
		arguments[1] = getMois();
		arguments[2] = getAnnee();
		return MessageFormat.format("{0}/{1}/{2}", arguments);
	}
}
